﻿function KeShi(model) {
    return {
        ksmc: model ? model.ksmc : "",
        ksid: model ? model.ksid : 0,
        ZhiWus: model && model.ZhiWus ? new ZhiWus(model.ZhiWus) : [],
        ZhiWustr: model && model.ZhiWus ? GetZhiWumc(model.ZhiWus) : ""
    };
}
function GetZhiWumc(model) {
    if (model) {
        var arr = [];
        $(model).each(function (i, item) {
            arr.push(item.zwmc);
            $(item.SonZhiWeis).each(function (i2, item2) {
                arr.push(item2.zwmc);
            });
        });
        return arr.join(",");
    }
}
function ZhiWus(model) {
    var arr = [];
    if (model) {
        $(model).each(function (i, item) {
            arr.push({
                zwid: item.zwid,
                zwmc: item.zwmc
            });
            $(item.SonZhiWeis).each(function (i2, item2) {
                arr.push({
                    zwid: item2.zwid,
                    zwmc: item2.zwmc
                });
            });
        });
    }
    return arr;
}
var ZhiWu = {
    zwid: 0,
    zwmc: "",
    pid: 0,
    gzjhid: 0,
    jxkhid: 0,
    ksid: 0,
    PowerTrees: []
}